<div class="row">
		<div class="col-lg-12">
			<h1 class="site-h1" style="background-color:#FFFFFF;">
				<#if dataDic??>
				${dataDic.name!''}
				<#else>
				已发布报表列表
				</#if>
				<#if reportList??>（${reportList.totalElements}）</#if>

				<span style="float:right;">
					<#if dataDic?? && dataDic.userauth>
					<a class="layui-btn layui-btn-sm green" href="/apps/report/auth.html?id=${dataDic.id!''}&type=dataDic&authtype=organ&dicid=${dataDic.id!''}" data-toggle="ajax" data-width="950" data-height="700" data-title="分类授权">
					部门授权
					</a>
					<a class="layui-btn layui-btn-sm green" href="/apps/report/auth.html?id=${dataDic.id!''}&type=dataDic&authtype=role&dicid=${dataDic.id!''}" data-toggle="ajax" data-width="950" data-height="500" data-title="分类授权">
					角色授权
					</a>
					<a class="layui-btn layui-btn-sm green" href="/apps/report/auth.html?id=${dataDic.id!''}&type=dataDic&authtype=user&dicid=${dataDic.id!''}" data-toggle="ajax" data-width="950" data-height="500" data-title="分类授权">
					用户授权
					</a>
					</#if>
					<#if dataDic??>
					<button class="layui-btn layui-btn-sm" href="/apps/report/auth/edittype.html?dicid=${dataDic.id!''}" data-toggle="ajax" data-width="400" data-height="250" data-title="编辑分类">
						编辑分类
					</button>
					</#if>
					<#if enabletneant?? && enabletneant == true>
						<button class="layui-btn layui-btn-sm green" href="/apps/report/selpbreportindex.html?mid=${dataDic.id!''}" data-toggle="ajax" data-width="950" data-height="500" data-title="引入公用报表">
						引入报表
						</button>
					</#if>
					<button class="layui-btn layui-btn-sm green" href="/apps/report/pub/imp.html?dicid=${dataDic.id!''}" title="导入已发布报表" data-toggle="ajax" data-width="650" data-height="350">
						<i class="kfont">&#xe641;</i>导入已发布报表
					</button>
					<a href="javascript:void(0)" class="layui-btn layui-btn-sm" id="reportexp" title="导出选中结果">
						<i class="kfont">&#xe672;</i>
						导出选中结果
					</a>
				</span>
			</h1>
			<div class="row" style="padding:5px;">
				<div class="col-lg-12">
					<table class="layui-table" lay-skin="line">
					  <colgroup>
					  		<col width="1%">
							<col width="40%">
							<col width="24%">
							<col width="30%">
							<col width="1%">
						<col>
					  </colgroup>
					  <thead>
						<tr>
						  <th style="width:1%;padding-right:0px;">
						  	<input type="checkbox" id="checkall" />
						  </th>
						  <th>名称</th>
						  <th>版本</th>
						  <th>创建时间</th>
						  <th style="white-space:nowrap;" nowrap="nowrap">操作</th>
						</tr> 
					  </thead>
					  <tbody>
						<#if reportList?? && reportList.content??>
						<#list reportList.content as report>
						<tr>
						  <td style="width:1%;padding-right:0px;">
							<input type="checkbox" class="ids" name="ids" value="${report.id!''}"/>
						  </td>
						  <td><a href="/apps/report/view.html?id=${report.id!''}" target="_blank"> 
								<#if report.name?? && report.name?length gt 100>${report.name[0..100]}...<#else>${report.name!''}</#if>(${report.code!''})
						  		</a>
						  </td>
						  <td>
								${report.dataversion!''} 
							</td>
						  <td>${report.createtime?string("yyyy-MM-dd HH:mm:ss")}</td>
						  <td style="white-space:nowrap;" nowrap="nowrap">
						  		<#if report?? && report.userauth && dataDic?? && dataDic.userauth>
								<a href="/apps/report/auth.html?id=${report.id!''}&type=report&authtype=organ&dicid=${dataDic.id!''}" data-toggle="ajax" data-width="950" data-height="500" data-title="分类授权">
									<i class="layui-icon">&#xe672;</i>
									部门授权
								</a>
								<a href="/apps/report/auth.html?id=${report.id!''}&type=report&authtype=role&dicid=${dataDic.id!''}" data-toggle="ajax" data-width="950" data-height="500" data-title="分类授权">
									<i class="layui-icon">&#xe672;</i>
									角色授权
								</a>
								<a href="/apps/report/auth.html?id=${report.id!''}&type=report&authtype=user&dicid=${dataDic.id!''}" data-toggle="ajax" data-width="950" data-height="500" data-title="分类授权">
									<i class="layui-icon">&#xe672;</i>
									用户授权
								</a>
								</#if>
								<a href="/apps/report/auth/editreport.html?reportid=${report.id!''}&dicid=${dataDic.id!''}" data-toggle="ajax" data-width="400" data-height="250" data-title="编辑报表">
									<i class="layui-icon">&#xe642;</i>
									编辑
								</a>
								<a href="/apps/report/pbdelete.html?id=${report.id!''}" style="margin-left:10px;" data-toggle="tip" data-title="请确认是否删除报表？">
									<i class="layui-icon" style="color:red;">&#x1006;</i>
									删除
								</a>
						  </td>
						</tr>
						</#list>
						<#else>
						<tr>
							<td colspan="20" style="height:400px;">
								<div class="ukefu-empty">
									<i class="layui-icon">&#xe63a;</i>
									<div style="">还没有记录</div>
								</div>
							</td>
						</tr>
						</#if>
					  </tbody>
					</table>
				</div> 	   
			</div>
			<div class="row" style="padding:5px;">
				<div class="col-lg-12" id="page" style="text-align:center;"></div>
			</div>
		</div>	
	</div>
<SCRIPT>
	$(document).ready(function(){
		$('#reportexp').click(function(){
			var ids = "";
			var num = 0 ;
			$('.ids').each(function(){
				if($(this).prop("checked")){
					if(ids!=""){
						ids += "&" ;
					}
					ids += "ids=" + $(this).val();
					num++;
				}
			});
			if(num>0){
				$('#reportexp').attr('href' , '/apps/report/pub/expids.html?'+ids)	;
			}else{
				top.layer.alert("请先选择需要导出的报表");
				$('#reportexp').attr("href" , "javascript:void(0)");
			}
		});
		
	});
	layui.use(['laypage', 'layer'], function(){
		  var laypage = layui.laypage
		  ,layer = layui.layer;
		  
		  laypage.render({
				elem: 'page'
				,pages: <#if reportList??>${reportList.totalPages}<#else>0</#if> //总页数
				,curr:<#if reportList??>${reportList.number+1}<#else>0</#if>
				,groups: 5 //连续显示分页数
				,jump:function(data , first){
					if(!first){
						loadURL("/apps/report/pbreportlist.html?p="+data.curr+"&dicid=<#if dataDic??>${dataDic.id!''}<#else>0</#if>","#ukefu-datadic-content");
					}
				}
		   });
	});
</SCRIPT>